package com.buric.user.controller;

import com.buric.api.dto.admin.LoginAdmin;
import com.buric.common.data.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhou.wei
 * @description 用户相关接口
 * @date: 2024/5/10 16:50
 */

@Api(tags = "用户相关接口")
@RestController
@RequestMapping("/user")
public class UserController {




    @ApiOperation("通过账号获取用户信息")
    @GetMapping("/info/{username}")
    public R<LoginAdmin> getUserByUsername(@PathVariable("username") String username) {
        LoginAdmin loginUser = new LoginAdmin();
        loginUser.setId(1L);
        loginUser.setUsername(username);
        loginUser.setPassword("$2a$10$nqrPMo4kqKMOo.RV/Y1UAuZD79AGMt/QJnZ.rv6Be.zBRecM7MPo6");
        loginUser.setSex(1);
        return R.ok(loginUser);
    }

}
